#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <ctype.h>

int main()
{
	int num = 0;
	int letter = 0;
	int space = 0;
	int others = 0;
	char ch;
	while ((ch = getchar()) != '\n')
	{
		if (isalpha(ch))
		{
			letter++;
		}
		else if (isdigit(ch))
		{
			num++;
		}
		else if (isspace(ch))
		{
			space++;
		}
		else
			others++;
	}

	printf("%d %d %d %d\n", letter, space, num, others);

		return 0;
}